<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ include file="config.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Insert title here</title>
<script type="text/javascript" src="${ctx}/js/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="${ctx}/js/orderManage.js"></script>
	<link href="${ctx}/css/orderManage.css" rel="stylesheet"/>
</head>
<body>
<div class="handler4">	
	<div>
		<span>订单管理</span><br/><br/>
		
		<table class="myTable1" >
			<tr class="tr1">
				<td class="td1">用户名：<input type="text"></td>
				<td colspan="2">下单时间：<input type="date" id="startDate" value="${startDate}"/>至 <input type="date" id="endDate" value="${endDate}"/></td>
			</tr>
			<tr class="tr2">
				<td class="td1">商品名称：<input type="text"></td>
				<td class="td1">审核状态：<select id="state">
					<option value="-3">-请选择-</option> 
					<option value="0" 			
						<c:if test="${state == 0}">selected</c:if>
					>未审核</option>
					<option value="1"
						<c:if test="${state == 1}">selected</c:if>
					>审核通过</option>
					<option value="-1"
						<c:if test="${state == -1}">selected</c:if>
					>不通过</option>
				</select></td>
				<td class="td1"><button id="search">查询</button></td>
			</tr>
		</table>
		
		<table class="myTable" >
			<tr class="tr1">
				<td class="td1"><span>订单编号</span></td>
				<td class="td1"><span>订单用户</span></td>
				<td class="td1"><span>总金额</span></td>
				<td class="td1"><span>下单时间</span></td>
				<td class="td1"><span>审核人</span></td>
				<td class="td1"><span>审核状态</span></td>
				<td class="td1"><span>更多操作</span></td>
			</tr>
			<c:forEach items="${pageOrder.list}" var="order">
				<tr id="${order.id}">
					<td class="td1">${order.id}</td>
					<td class="td1"><span>${order.uid}</span></td>
					<td class="td1"><span>￥${order.total}</span></td>
					<td class="td1"><span>${order.date}</span></td>
					<td class="td1"><span>${order.auditor}</span></td>
					<td class="td1"><span>			
						<c:choose>
							<c:when test="${order.state == 0}">
								未审核
							</c:when>
							<c:when test="${order.state == -1}">
								不通过
							</c:when>
							<c:otherwise>
								审核通过
							</c:otherwise>
						</c:choose>
					</span></td>
					<td class="td1"><a class="toOrderInfo" id="examine" href="#">查看</a>&nbsp&nbsp
					<a href="#" class="audit">审核</a>&nbsp&nbsp<a href="#">修改</a></td>
				</tr>
			</c:forEach>
		</table>	
		</div>
		<div class="bottom">
			当前<span id="currentPage">${pageOrder.currentPage + 1}</span>/<span id="totalPage">${pageOrder.totalPage}</span>页，
			共${pageOrder.totalCount}条记录&nbsp&nbsp&nbsp&nbsp&nbsp
			<a href="#" id="firstPage">首页</a>&nbsp&nbsp&nbsp<a href="#" id="parentPage">上一页</a> &nbsp&nbsp&nbsp&nbsp
			<a href="#" id="nextPage">下一页</a>&nbsp&nbsp&nbsp&nbsp<a href="#" id="lastPage">尾页</a>&nbsp&nbsp&nbsp&nbsp每页
			<input id="pageSize" style="width: 31px;" type="number" min="1" max="5" value="${pageOrder.pageSize}">
			 条记录&nbsp&nbsp&nbsp&nbsp转到
			<select id="selectPage">
				<c:forEach begin="1" end="${pageOrder.totalPage}" var="currentPage" >
					<c:choose>
						<c:when test="${(pageOrder.currentPage+1) == currentPage}">
				    		<option selected="selected">${currentPage}</option>
						</c:when>
						<c:otherwise>
				    		<option>${currentPage}</option>
						</c:otherwise>
					</c:choose>
				</c:forEach>
			</select>页
		</div>
</div>
</body>
</html>